const mongoose = require('mongoose')

mongoose.connect('mongodb://127.0.0.1:27017/sh2205')

mongoose.connection.on('connected',()=>{
    console.log('连接上了')
})

mongoose.connection.on('error',()=>{
    console.log('连接失败')
})

mongoose.connection.on('disconnected',()=>{
    console.log('连接断开')
})

module.exports = mongoose

// const userSchema = new mongoose.Schema({
//     username:{type:String},
//     password:{type:String},
//     isLogin:{type:Number},
//     hobbies:{type:Array},

// })

// const abc = mongoose.model('users',userSchema)





// abc.insertMany([{username:'张三'}])

// abc.deleteOne({username:'张三'},err=>{
//     if(err){
//         console.log(err)
//     }
// })